const KoaRouter = require('koa-router');
const router = new KoaRouter();
const { query } = require('./utility');

router.get('/', async (ctx) => {
    // 查询数据库
    const res = await query('select username, theory, skill from score');
    console.log(res);
    ctx.body = res;
});

router.post('/', async (ctx) => {
    ctx.body = '添加成绩接口';
});

router.put('/:id', async (ctx) => {
    ctx.body = '修改成绩信息接口';
});

router.delete('/:id', async (ctx) => {
    ctx.body = '删除成绩接口';
});

module.exports = router;
